﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;


namespace AlphaWebsite.Models
{
    public class User
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid UserID { get; set; }
        [Required]
        public string UserName { get; set; }
        [Required]
        public string Password { get; set; }
        [Required]
        public bool IsVendor { get; set; }
        [Required]
        public bool IsActive { get; set; }
    }
    public class UserPersonalInformation
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        [Required]
        public Guid? UserID { get; set; }
        [ForeignKey("UserID")]
        public virtual User User { get; set; }
        [Required]
        public string Role { get; set; }
        [Required]
        public string FirstName { get; set; }
        [Required]
        public string LastName { get; set; }
        [Required]
        public string ScreenName { get; set; }
        [Required]
        public string EmailAddress { get; set; }
        [Required]
        public string Address1 { get; set; }
        [Required]
        public string Address2 { get; set; }
        [Required]
        public Guid? CityID { get; set; }
        [ForeignKey("CityID")]
        public virtual City City { get; set; }
        [Required]
        public Guid? DistrictID { get; set; }
        [ForeignKey("DistrictID")]
        public virtual CityDistrict District { get; set; }
        public string HomePhone { get; set; }
        public string MobilePhone { get; set; }
        public string WorkPhone { get; set; }
        public string Ext { get; set; }
        public string Fax { get; set; }
        
     }
    public class City
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid CityID { get; set; }
        [Required]
        public string CityName { get; set; }
    }
    public class CityDistrict
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid DistrictID { get; set; }
        [Required]
        public string CityDistrictName { get; set; }
    }
    public class BudgetCategory
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid BudgetCategoryID { get; set; }
        [Required]
        public string BudgetCategoryName { get; set; }
        [Required]
        public bool IsActive { get; set; }
    }
    public class BudgetItems
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid BudgetItemsID { get; set; }
        [Required]
        public Guid? BudgetCategoryID { get; set; }
        [ForeignKey("BudgetCategoryID")]
        public virtual BudgetCategory BudgetCategory { get; set; }
        [Required]
        public string BudgetItemsName { get; set; }
        public Guid? UserWeddingPlanID { get; set; }
        [ForeignKey("UserWeddingPlanID")]
        public virtual UserWeddingPlan UserWeddingPlan { get; set; }
        public decimal EstimatedCost { get; set; }
        public decimal ActualCost { get; set; }
        public decimal AmountPaid { get; set; }
        public decimal AmountDue { get; set; }
        public DateTime? Modified { get; set; }
        public DateTime? Created { get; set; }
        [Required]
        public string ModifedBy { get; set; }
        [Required]
        public string CreatedBy { get; set; }
    }
    public class UserWeddingPlan
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid UserWeddingPlanID { get; set; }
        [Required]
        public Guid CreatedBy { get; set; }
        public Guid? UserID { get; set; }
        [ForeignKey("UserID")]
        public virtual User User { get; set; }
        public DateTime Created { get; set; }

    }
    public class DefaultBudgetItems
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid ItemID { get; set; }
        public Guid? BudgetCategoryID { get; set; }
        [ForeignKey("BudgetCategoryID")]
        public virtual BudgetCategory BudgetCategory { get; set; }
        [Required]
        public string Name { get; set; }
        public decimal EstimatedCost { get; set; }
        public decimal ActualCost { get; set; }
        public decimal AmountPaid { get; set; }
        public decimal AmountDue { get; set; }
        public double CostPercent { get; set; }
        public bool IsFixPercent { get; set; }
        public decimal MinimumAmount { get; set; }
        public DateTime? Modified { get; set; }
        public DateTime? Created { get; set; }
        [Required]
        public Guid ModifedBy { get; set; }
        [Required]
        public Guid CreatedBy { get; set; }
    }
    public class WeddingPlanRelatedUsers
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid UserWeddingPlanID { get; set; }
        public Guid? UserID { get; set; }
        [ForeignKey("UserID")]
        public virtual User User { get; set; }
    }
    public class DefaultEvents
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid EventID { get; set; }
        [Required]
        public string EventName { get; set; }

    }
    public class WeddingSides
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid WeddingSideID { get; set; }
        [Required]
        public string SideName { get; set; }

    }
    public class WeddingEvents
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid WeddingEventID { get; set; }
        [Required]
        public string EventName { get; set; }
        public Guid? UserWeddingPlanID { get; set; }
        [ForeignKey("UserWeddingPlanID")]
        public virtual UserWeddingPlan UserWeddingPlan { get; set; }
    }
    public class WeddingHouseholds
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid HouseholdID { get; set; }
        [Required]
        public string HousholdName { get; set; }
        public Guid? UserWeddingPlanID { get; set; }
        [ForeignKey("UserWeddingPlanID")]
        public virtual UserWeddingPlan UserWeddingPlan { get; set; }
    }
    public class WeddingEventLists
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid EventListID { get; set; }
        public Guid? WeddingEventID { get; set; }
        [ForeignKey("WeddingEventID")]
        public virtual WeddingEvents WeddingEvents { get; set; }
        [Required]
        public string EventListName { get; set; }

    }
    public class WeddingEventGuests
    {
        [Key]
        [Column(Order=0)]
        public Guid? WeddingEventID { get; set; }
        [Key]
        [Column(Order = 1)]
        public Guid? GuestID { get; set; }        
        
        [ForeignKey("WeddingEventID")]
        public virtual WeddingEvents WeddingEvents { get; set; }

        [ForeignKey("GuestID")]
        public virtual Guests Guests { get; set; }

    }
    public class Guests
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public Guid GuestID{get;set;}
        [Required]
        public string GuestFullName{get;set;}
        public Guid? HouseholdID { get; set; }
        [ForeignKey("HouseholdID")]
        public virtual WeddingHouseholds WeddingHouseholds { get; set; }
        public Guid? EventListID { get; set; }
        [ForeignKey("EventListID")]
        public virtual WeddingEventLists WeddingEventLists { get; set; }
        public Guid WeddingSideID { get; set; }
        [ForeignKey("WeddingSideID")]
        public virtual WeddingSides WeddingSides { get; set; }

    }
}